<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Autocomplete Demos</title>
	<script type="text/javascript">
		var Global = {
			contextPath:'/bingo.ui.framework'
		} 
	</script>
	<script src="../../../../scripts/jquery.js" type="text/javascript"></script>
	<script src="../../../../scripts/jquery.utils.js" type="text/javascript"></script>

	<script src="../../../../scripts/jquery_ui/jquery.ui.core.js" type="text/javascript" ></script>
	<script src="../../../../scripts/jquery_ui/jquery.ui.widget.js" type="text/javascript" ></script>
	<script src="../../../../scripts/jquery_ui/jquery.ui.position.js" type="text/javascript" ></script>
	
	<link  href="../../../../themes/default/ui.css" type="text/css" rel="stylesheet" />
	
	<!-- 换肤 -->
	<script type="text/javascript" src="../../../theme_cookie.js"></script>
		
	<script src="../jquery.ui.autocomplete.js" type="text/javascript"></script>
	<link  href="../autocomplete.css" type="text/css" rel="stylesheet" />
	
	<link type="text/css" href="../../../demos.css" rel="stylesheet" />
	<script src="../../../../scripts/jquery_plugins/jquery.json.js" type="text/javascript"></script>

	<script>
		$( function(){
			/*
			$("#remote").autocomplete({
				minLength:1,//最小输入1个字符触发事件
       		    source: function(req, resp){
					$.request({
	                    url: '../demo-data.json' ,
	                    data: req.term ,
	                    success: function(response){//json
	                    	resp($.map(response, function(item) {
								return {
									label: item.text,
									value: item.value
								}
							}));
	                    } 
	                });
	           }
			});
			*/
			$("#remote").autoComplete({
				minLength:1,//最小输入1个字符触发事件
       		    source : 'remote',
       		    CommandName : 'sqlid:autocomplete.test',
       		    variableName : 'INPUT_VALUE',
       		    params : {
					daoBeanName:'dao',
       		        catalogId : 'sale',
       		        sqlId:'autocomplete.test'
           	    }
			});
		} ) ;
	</script>
	
	<style>
		input{
			width:200px;
		}
		
		
	</style>
</head>

<body>
	<br/><br/>
	<input type='text' id='remote' value=''>
	<br><br>
	<div class='ui-state-highlight'>
		测试数据：<br>
		[{"name":"hunan","text":"湖南"},{"name":"hubei","text":"湖北"}]
	</div>
</body>
</html>